package com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.view;

import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.R;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.base.BaseActivity;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.contract.IAddConfigFileContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.persenter.AddConfigFilePersenter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.utils.MyToastUtils;

/**
 * Created by Administrator on 2018/8/21.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class AddConfigFileActivity extends BaseActivity implements IAddConfigFileContract.IAddConfigFileView {

    private EditText et_input_file_name;
    private EditText et_input_metting_name;
    private AddConfigFilePersenter mAddConfigFilePersenter = new AddConfigFilePersenter(this);
    private String devicesId;

    @Override
    protected void userAgreedPermissions() {

    }

    @Override
    protected View AddLayoutView() {
        View view = View.inflate(this, R.layout.activity_add_config_file,null);
        et_input_file_name = view.findViewById(R.id.activity_add_config_file_et_input_file_name);
        et_input_metting_name = view.findViewById(R.id.activity_add_config_file_et_input_metting_name);
        return view;
    }

    @Override
    protected void initChildViewDate() {
        devicesId = getIntent().getStringExtra("my_devices_id");
        mAddConfigFilePersenter.initTtile();

    }

    @Override
    protected void onClickedTvRight() {
        mAddConfigFilePersenter.saveConfigFileName(this,devicesId);
    }

    @Override
    protected void onClickedIvRight() {

    }

    @Override
    protected void onClickedIvLeft() {
            finish();
    }

    @Override
    public void showTitle() {
        showTilteBg();
        showTitleContent();
        showTileIvLeft();
        showTilteRightTVContent();
        //设备管理(6)
        setTitleContent("配置文件设置", 0xffffffff);
        setTilteRightTVContent("保存",0xffffffff);
        setIvLeftIcon(R.mipmap.left_white_return);
        setTitleContentSize(16);
    }

    @Override
    public void showMessage(String message) {
        MyToastUtils.ShortToaseShow(this,message);
    }

    @Override
    public String getInputFileName() {
        return et_input_file_name.getText().toString().trim();
    }

    @Override
    public String getInputMettingName() {
        return et_input_metting_name.getText().toString().trim();
    }

    @Override
    public void finshPager() {
        finish();
    }
}
